-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add TimeBoundedPopScore for time-bounded popularity #493
base: main
Are you sure you want to change the base?
Conversation
def fit(self, data: Dataset, **kwargs): | ||
_logger.info("counting time-bounded item popularity") | ||
|
||
log = data.interaction_log("numpy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about adding a function to time bound a DataSet
, but realized that might be too much since we are just going to use the counts - I assume that would still be useful for some things (validation set?) but doing the calculation here seems cheaper. LMK if this seems right!
def test_time_bounded_pop_score_rank(): | ||
algo = basic.TimeBoundedPopScore(2 * day, "rank") | ||
algo.fit(simple_ds) | ||
assert algo.item_scores_.equals(pd.Series([1.5, 3.0, 1.5], index=[1, 2, 3])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests here seems very low level but I think it is OK since the internals are important and are likely to be stable over time?
The LensKit 🤖 has run the tests on your PR. ✅ Tests covered 95.83% of diff. ✅ Coverage increased 0.01% from 92.47% to 92.48%. origin/main...HEAD, staged and unstaged changes
Summary
Source Coverage Report
|
Implements #359.